<?php
include_once '../data/database_dal.php';

class CompoundDAL extends DatabaseDAL
{
    function update($id, $rfqID, $color, $effect, $application, $shade, $exactness, $physicalProperty, $translucency, $colorReference, $inTime, $inUSer)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_compound_update('". $id ."', '". $rfqID ."', '". $color ."', '". $effect ."', '". $application ."', '". $shade ."', '". $exactness ."', '". $physicalProperty ."', '". $translucency ."',
                                                        '". $colorReference ."', '". $inTime ."', '". $inUSer ."')");
        $this->close();
        return $result;
    }

    function get($where)
    {
        $this->connect();
        return $this->mysqli->query("call pr_user_get(".'"'.$where.'"'.")");
        $this->close();
        return $result;
    }

    function getAll($orderBy)
    {
        $this->connect();
        $result =  $this->mysqli->query("call pr_compound_list('". $orderBy ."')");
        $this->close();
        return $result;
    }

    function delete($id)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_compound_delete('". $id ."')");
        $this->close();
        return $result;
    }
} 
?>
